package com.rstrulak.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "NOTE_ATTACHMENTS")
public class NoteAttachments {
	private Long id;
	private Note note;
	private String filePath;
	private String fileName;
	@Transient
	private Boolean isChecked;

	@Id
	@GeneratedValue(generator = "gen_project")
	@SequenceGenerator(name = "gen_project", sequenceName = "NOTE_ATTACHMENTS_SEQ")
	@Column(name = "ID", nullable = false, unique = true)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "NOTE_ID", nullable = false)
	public Note getNote() {
		return note;
	}

	public void setNote(Note note) {
		this.note = note;
	}

	@Column(name = "FILE_PATH", nullable = false)
	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	@Column(name = "FILE_NAME", nullable = false)
	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	@Transient
	public Boolean getIsChecked() {
		return isChecked;
	}

	@Transient
	public void setIsChecked(Boolean isChecked) {
		this.isChecked = isChecked;
	}

}
